﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <script src="~/plugins/mzui/js/mzui.min.js"></script>
    <link href="~/plugins/mzui/css/mzui.min.css" rel="stylesheet" />
    <title>最惠商家</title>
    <style>
        .tiles .cell {
            flex: none;
        }
    </style>
</head>
<body class="with-nav-bottom">
    <div class="list" id="tbody">
        <script id="tpl" type="text/html">
            {{each list as item index}}
            <a href="/home/buy?gid={{item.gid}}&zan={{item.zan}}" class="item multi-lines white">
                <div class="avatar avatar-xl"><img src="{{item.picture}}" onerror="this.src = '/images/nopic.png'" /></div>
                <div class="content">
                    <div class="title">
                        {{item.name}}
                        {{if item.sort=="0"}}
                        <div class="label danger outline">客满</div>
                        {{else}}
                        {{/if}}
                    </div>
                    <div class="subtitle">{{item.city}}{{item.area}}{{item.address}}</div>
                    <div class="row tiles">
                        <div class="cell"><div class="label info outline">{{item.tese}}</div></div>
                    </div>
                    <table class="table borderless compact">
                        <tr>
                            <td><label class="label info rounded">{{item.zhekou}}</label></td>
                            <td><label class="small text-gray">人均:{{item.xfx}}-{{item.xfd}}</label></td>
                            <td class="btn has-badge"><i class="icon-thumbs-up"></i> <span class="label info-pale">{{item.zan}}</span></td>
                        </tr>
                    </table>
                </div>
            </a>
            <div class="divider"></div>
            {{/each}}
        </script>
    </div>
    <div class="heading">
        <div id="nextpage" class="title text-center" onclick="getlist(document.getElementById('pageindex').innerHTML,0);">显示更多 <i class="icon icon-double-angle-down"></i></div>
    </div>
    <div id="ss" class="affix dock-bottom modal hidden">
        <div class="heading">
            <div class="title"><strong>搜索</strong></div>
            <nav class="nav"><a data-dismiss="display"><i class="icon-remove muted"></i></a></nav>
        </div>
        <div class="divider"></div>
        <div class="section box">
            <div class="control has-success">
                <label for="address">套餐名称</label>
                <input name="name" type="text" class="input" placeholder="请输入你要搜索的套餐名称">
            </div>
            <div class="control">
                <label>套餐类别</label>
                @*<div class="radio inline-block">
                    <input type="radio" name="fl" checked="checked" onchange="setfl('0')">
                    <label for="fl">全部</label>
                </div>
                <div class="radio inline-block">
                    <input type="radio" name="fl" value="@item.gid" onchange="setfl('@item.gid')">
                    <label for="fl">@item.name</label>
                </div>*@
                @foreach (var item in Model)
                {
                    <input type="checkbox" name="fl" value="@item.gid" checked="checked" onclick="setfl()">@item.name
                }
                <input id="flgid" name="flgid" type="text" class="hidden">
            </div>
            <div class="control">
                <button type="button" data-dismiss="display" class="btn block primary" onclick="getlist(1,1);">给我搜</button>
            </div>
        </div>
    </div>
    <nav class="nav affix dock-bottom justified">
        <a href="/home/index" class="active text-info">商城</a>
        <a href="/user/grzx">我的</a>
        <a data-display data-backdrop="true" data-target="#ss"><i class="icon icon-search"></i> 搜索</a>
    </nav>
    <nav class="affix dock-bottom dock-right fab has-padding shadow-none" style="margin-bottom:58px">
        <a href="/home/city" class="btn circle primary-pale"><i class="icon icon-map-marker">@ViewBag.city</i></a>
    </nav>
    <label id="pageindex" class="hidden">0</label><label id="pages" class="hidden">1</label>
    <label id="Controllers" class="hidden">/home/shoplist</label>
    <script src="~/js/template-web.js"></script>
    <script src="~/js/mlist.js"></script>
    <script>
        function setfl() {
            document.getElementById("flgid").value = "";
            var groupCheckbox = $("input[name='fl']");
            for (i = 0; i < groupCheckbox.length; i++) {
                if (!groupCheckbox[i].checked) {
                    var val = groupCheckbox[i].value;
                    document.getElementById("flgid").value +=  val + ",";
                }
            }
        }
    </script>
</body>
</html>